package com.example.chinesechess.presentation.ui

import androidx.compose.runtime.Composable
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.example.chinesechess.presentation.ui.screen.HomeScreen
import com.example.chinesechess.presentation.ui.screen.GameScreen
import com.example.chinesechess.presentation.ui.screen.OnlineScreen
import com.example.chinesechess.presentation.ui.screen.SettingsScreen
import com.example.chinesechess.presentation.ui.screen.GameRecordsScreen

@Composable
fun ChineseChessApp() {
    val navController = rememberNavController()
    
    NavHost(navController = navController, startDestination = Screen.Home.route) {
        composable(Screen.Home.route) {
            HomeScreen(navController = navController)
        }
        composable(Screen.Game.route + "/{gameMode}") { backStackEntry ->
            val gameMode = backStackEntry.arguments?.getString("gameMode") ?: "local"
            GameScreen(navController = navController, gameMode = gameMode)
        }
        composable(Screen.Online.route) {
            OnlineScreen(navController = navController)
        }
        composable(Screen.Settings.route) {
            SettingsScreen(navController = navController)
        }
        composable(Screen.GameRecords.route) {
            GameRecordsScreen(navController = navController)
        }
    }
}

sealed class Screen(val route: String) {
    object Home : Screen("home")
    object Game : Screen("game")
    object Online : Screen("online")
    object Settings : Screen("settings")
    object GameRecords : Screen("game_records")
} 